package com.zhang.method;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class RequestMappingTestMethod {

//    如果要求前端发送POST请求
//    @RequestMapping(value = "/login", method = RequestMethod.POST)
//    public String login(){
//        return "success";
//    }


    //@RequestMapping(value="/login", method = RequestMethod.POST)
    //@PostMapping("/login")
    //@RequestMapping(value="/login", method = RequestMethod.PUT)
    //@RequestMapping(value="/login", method = RequestMethod.GET)
    @RequestMapping("/login")
    //即使form中method设置为put方式，但仍然采用get方式发送请求
    public String testMethod(){
        return "success";
    }


}
